<script type="text/javascript">
function custom_upload_success(file, data, $upload){
	var json = $.parseJSON(data)
    if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
    	$("#${formid}").alertmsg('correct', json[BJUI.keys.message]);
    	$.CurrentNavtab.navtab('reloadForm', true);
    }else{
    	$("#${formid}").alertmsg('error', json[BJUI.keys.message]);
    }
}
</script>
<div class="bjui-pageHeader">
	<form id="pagerForm" data-toggle="ajaxsearch" action="${rootpath}/File/list" method="post">
        <input type="hidden" name="pageSize" value="${(page.pageSize)!15}">
        <input type="hidden" name="pageCurrent" value="${(page.pageCurrent)!1}">
        <input type="hidden" name="orderField" value="${(page.orderField)!"name"}">
        <input type="hidden" name="orderDirection" value="${(page.orderDirection)!"asc"}">
        
        <div class="bjui-searchBar">
        	<a
                            data-toggle="upload" 
                            data-button-text="上传文件" data-auto="true" 
                            data-preview-img="false" 
                            data-uploader="${rootpath}/File/upload" 
                            data-file-size-limit="1024000000"
                            data-file-type-exts="*.doc;*.docx;*.xls;*.xlsx;*.ppt;*.pptx;" 
                            data-on-upload-success="custom_upload_success"></a>&nbsp;
            <label>名称：</label><input type="text" value="${name!}" name="name" size="15" />&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <a class="btn btn-orange" href="javascript:;" onclick="$(this).navtab('reloadForm', true)" data-icon="undo">清空查询</a>&nbsp;
            <div class="pull-right">
                
            </div>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
	<div class="col-md-12">
    <form action="" class="pageForm" data-toggle="validate" method="post">
        <table class="table table-bordered table-hover table-striped table-top" data-toggle="tabledit" data-layout-h="0">
            <thead>
                <tr>
                    <th data-order-field="id" title="ID" width="200"><input type="text" name="id"   value="" ></th>
                    <th data-order-field="name" title="名称" width="200"><input type="text" name="name"  value="" ></th>
                    <th data-order-field="type" title="类型" width="200"><input type="text" name="type"  value="" ></th>
                	<th data-order-field="ver" title="版本" width="80"><input type="text"  name="ver" value="" ></th>
                	<th title="操作" width="200">
                	</th>
                </tr>
            </thead>
            <tbody>
                <#if (page.pageData)?exists>
	                <#list page.pageData as item>
	                	<#if item?exists>
	                		<tr data-id="">
				                <td>${item.id!}</td>
				                <td>${item.name!}</td>
				                <td>${item.type!}</td>
				                <td>${item.ver!}</td>
				                <td data-notread="true">
                        			<a href="${rootpath}/ViewOffice/view?fileid=${item.id}" target="_blank" class="btn btn-green">预览</a>
                    			</td>
				            </tr>
	                	</#if>
	                </#list>
            	</#if>
            </tbody>
        </table>
 	</form>
 	</div>
    <div class="bjui-pageFooter">
		<div class="pages">
			<span>每页&nbsp;</span>
			<div class="selectPagesize">
				<select data-toggle="selectpicker" data-defval="${page.pageSize!}" data-toggle-change="changepagesize" >
		    		<option value="15">15</option>
		        	<option value="30">30</option>
		        	<option value="50">50</option>
		        	<option value="100">100</option>
		    	</select>
			</div>
			<span>&nbsp;条，共 ${(page.totalRow)!0} 条</span>
		</div>
		<div class="pagination-box" data-toggle="pagination" data-total="${(page.totalRow)!0}" data-page-size="${(page.pageSize)!15}" data-page-current="${(page.pageCurrent)!1}">
		</div>
	</div>
</div>





